package net.cdsunrise.com.auth.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.security.oauth2.provider.token.ConsumerTokenServices;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.security.Principal;

/**
 * @author: LiuWei
 * @date: Create in 14:47 2018/05/09
 */
@RestController
public class UserController {

    @Autowired
    @Qualifier("consumerTokenServices")
    ConsumerTokenServices consumerTokenServices;

    @GetMapping("user")
    public Principal getUser(Principal user) {
        System.out.println(user);
        return user;
    }

}
